<?php
declare(strict_types=1);

namespace App\Controller\v1;

use Throwable;
use App\Helper\Log;
use App\Helper\Util;
use App\Helper\Common;
use Hyperf\DbConnection\Db;
use App\Constants\ReturnCode;
use Hyperf\Di\Annotation\Inject;
use App\Controller\AbstractController;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Annotation\Middleware;
use App\Service\UserService;
use App\Middleware\Api\AuthMiddleware;

#[Controller]
#[Middleware(AuthMiddleware::class)]
class UserController extends AbstractController
{
    #[Inject]
    protected UserService $userServ;

    #用户微信公众号关注状态
    #[RequestMapping(path: "wxsubstatus", methods: "post")]
    public function wxsubstatus(){
        $user_id = $this->request->getAttribute('user_id');
        $this->userServ->setUserId($user_id);
        $res = $this->userServ->checkSubStatus();
        return $this->fmt_response(ReturnCode::deal_succ, '获取成功', $res);
    }
    
}